<?php


if (!defined("EXPONENT")) exit("");
	$music= null;
	if (isset($_GET['id'])) {
		$music= $db->selectObject("musics","id=".$_GET['id']);
		// ok, get album_id in hrere
	}
	
	if (exponent_users_isLoggedIn() && isset($_GET['album_id'])) {
		// get album_type
		$album=$db->selectObject('album','id = ' . $_GET['album_id']);
    $form = musics::form($music);
		$form->meta("action","save_musics");
		$form->meta("module","musicsmodule");
		
		$template = new template("musicsmodule","_form_edit",$loc);
		$template->assign("is_edit",(isset($music->id) ? 1 : 0));
		$template->assign("form_html",$form->toHTML());
		$template->output();
	} else {
		echo SITE_403_HTML;
	}

?>
